#ifndef HTTPUTILS_H
#define HTTPUTILS_H

#include <qhttpresponse.h>

class HttpUtils
{
public:
    static void writeResponse(QHttpResponse *resp, QString contentType, QByteArray &body);
    static void writeJsonResponse(QHttpResponse *resp, QString jsonString);
    static void responseError(QHttpResponse *resp, QString errorMessage);

    static QString extractGetParam(QString query, QString paramName);

private:
    static int findParamData(QString query, QString paramName);
};

#endif // HTTPUTILS_H
